public class PrimeNumber {

  public static void main(String[] args) {
    for (int i = 2; i < 100; i++) {
      if (isPrime(i)) {
        System.out.print(i);
        System.out.print(" ");
      }
    }
    System.out.println();
  }

  private static boolean isPrime(int number) {
    if (number == 2)
      return true;
    if (number % 2 == 0)
      return false;
    for (int i = 3; i * i < number; i += 2) {
      if (number % i == 0)
        return false;
    }
    return true;
  }

}
